package com.trivia.restServices

import com.trivia.Level;
import com.trivia.restResponses.GetAllLevelsResponse;
import com.trivia.restResponses.ServerResponse;

class GetLevelsController extends AbstractController {

	def index = {
		execute()
	}
	
    def executeTry() {
		List levels = Level.createCriteria().list(sort:"orderInFront", order:"asc"){}
		response = new GetAllLevelsResponse(status: ServerResponse.okResponse, description: ServerResponse.responses[ServerResponse.okResponse],levels:levels)
	}
}
